﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Datorgrafik_lab2.Components.Input;

namespace Datorgrafik_lab2.Objects
{
    public abstract class PlayerObject
    {
        public enum Directions { North = 1, East, South, West }

        public Matrix _world;
        public Quaternion Rotation;
        public Vector3 Position;
        protected float Scale;
        public int speed;
        public Directions direction;
        protected Vector2 pos2d;

        public PlayerObject(Matrix _world)
        {
            this._world = _world;
            Position = Vector3.Zero;
            Rotation = Quaternion.Identity;
            Scale = 0.005f;
            speed = 1;
            direction = Directions.North;
            this.pos2d = new Vector2(0, 0);
        }

        public void DecreaseSpeed(int valueOfDecrease)
        {
            speed -= valueOfDecrease;
            if (speed < 0) speed = 0;
        }

        public void IncreaseSpeed(int valueOfIncrease) {
            speed += valueOfIncrease;
            if (speed >= 15) speed = 15;
        }

        public void Turn(Directions newDirection)
        {
            this.direction = newDirection;
        }
    }
}